import turtle

def turtleY(l):
	turtle.pensize(l/10)
	turtle.fd(l)
	if l<5:
		turtle.bk(l)
		return
	turtle.lt(30)
	turtleY(l*0.5)
	turtle.rt(60)
	turtleY(l*0.8)
	turtle.lt(30)
	turtle.bk(l)

def morsetye(n):
	if n==0:
		return 0
	if n % 2 == 1:
		return 1-morsetye(n/2)
	else:
		return morsetye(n/2)

def coch(n):
	for i in range(n):
		d=morsetye(i)
		if d==0:
			turtle.rt(60)
		elif d==1:
			turtle.fd(6)

def c2(l):
	if l<4:
		turtle.fd(l)
		return
	c2(l/3)
	turtle.lt(60)
	c2(l/3)
	turtle.rt(120)
	c2(l/3)
	turtle.lt(60)
	c2(l/3)

turtle.shape('turtle')
turtle.speed(2)
turtle.lt(90)
turtle.pendown()

def cochstar(l):
	c2(l)
	turtle.right(120)
	c2(l)
	turtle.right(120)
	c2(l)

def cochsnowball():
	for i in range(3):
		cochstar(100)
		cochstar(100)
		cochstar(100)
		c2(100)
		turtle.left(120)
		c2(100)

def dragoncurve(l,n):
	def x(n):
		if n==0:
			return
		x(n-1)
		turtle.rt(90)
		y(n-1)
		turtle.fd(l)
	def y(n):
		if n==0:
			return
		turtle.fd(l)
		x(n-1)
		turtle.lt(90)
		y(n-1)
	turtle.fd(l)
	x(n)
dragoncurve(3,12)


raw_input()
